package com.example.bookstore.entity

import javax.persistence.*

/**
 * Created by IntelliJ IDEA.
 * User: lvshe
 * Date: 2019/8/10
 * Time: 20:10
 */
@Table
@Entity
class TopRecommendedBookEntity : BaseEntity {

    constructor() : super()
    constructor(name: String, order: Int, book: BookEntity) : super() {
        this.name = name
        this.order = order
        this.book = book
    }


    @Column(nullable = false)
    var name: String = ""


    @Column(nullable = false, name = "t_order")
    var order: Int = 0

    @OneToOne(optional = false)
    @JoinColumn(name = "book_id", unique = true, nullable = false, updatable = false)
    lateinit var book: BookEntity

}